#!/bin/bash
# Script de lancement du chat via Yarn
echo "Démarrage"
echo "Téléchargement du launcher sous HDFS"
hadoop fs -copyFromLocal Yarn-Launcher.jar hdfs:///Yarn-Launcher.jar
echo "Téléchargement de la commande à exécuter"
hadoop fs -copyFromLocal startChat.sh hdfs:///startChat.sh
echo Nombre de containers demandés ?
read n
echo "Adresse du serveur Zookeeper ?"
read adresse
echo $adresse > adresse.txt
echo "Nombre de processus avant déblocage"
read deb
echo $deb >> adresse.txt
# The script executed on $n containers, can't be executed from HDFS
scrip="/usr/users/promo2014/chassang_ant/Jars/benchmark/getScript.sh"
# We call for the class Client of Yarn-Launcher which will launch an instance of the class Application Master directly from the HDFS file.
hadoop jar Yarn-Launcher.jar com.hortonworks.simpleyarnapp.Client $scrip $n hdfs:///Yarn-Launcher.jar
echo "fin du launcher" 
